#ifndef SCENEWRITER_H
#define SCENEWRITER_H

#include <QDomDocument>
#include <QDomElement>
#include <scene.h>
#include <engine.h>
#include <gfx/idevice.h>
#include <gfx/mesh.h>


class SceneWriter
{
private:
  ceEngine*   _engine;
  iDevice*   _device;

  QDomElement CreateShadowElement (QDomDocument doc, EntityNode* entity);
  QDomElement CreateMatrix4f (QDomDocument doc, const ceMatrix4f& matrix);

public:
  SceneWriter(ceEngine* engine);

  QDomElement CreateGeometryElement (QDomDocument doc, Geometry* geometry);

  QDomElement CreateNodeElement (QDomDocument doc, ceNode* node);
  QDomElement CreateLODNodeElement (QDomDocument doc, LODNode* lod);
  QDomElement CreateEntityNodeElement (QDomDocument doc, EntityNode* entity);
  QDomElement CreateGroupNodeElement (QDomDocument doc, GroupNode* group);

  void WriteNode (ceNode* node, const QString& filename);

};

#endif // SCENEWRITER_H
